package pers.qianyu.module.recommend.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.qianyu.module.core.comm.HttpResult;
import pers.qianyu.module.core.comm.Pagination;
import pers.qianyu.module.core.domain.image.query.ImageQuery;
import pers.qianyu.module.core.domain.image.vo.ImageVO;
import pers.qianyu.module.logging.annotation.ControllerLog;
import pers.qianyu.module.logging.enums.BusinessType;
import pers.qianyu.module.recommend.service.RecommendService;

/**
 * @author mizzle rain
 * @date 2021-04-21 20:07
 */
@Api(tags = "推荐功能相关接口")
@RestController
@RequestMapping("reco-serv")
public class RecommendController {
    @Autowired
    private RecommendService recommendService;

    @ApiOperation("查询所有推荐的图片")
    @ControllerLog(businessType = BusinessType.QUERY)
    @RequestMapping("images")
    public HttpResult<Pagination<ImageVO>> getRecommendImages(ImageQuery imageQuery) {
        Pagination<ImageVO> page = recommendService.getRecommendImages(imageQuery);
        return HttpResult.okWithData(page);
    }
}
